package com.zeny.mycrm.controller;

import com.zeny.mycrm.model.MonthIncome;
import com.zeny.mycrm.service.DataAnalysisService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

import java.util.List;

/**
 * @ClassName DataAnalysisController
 * @Description 数据分析--收入报表
 * @Author zeny
 */
@Controller
@RequestMapping("/dataanalysis")
public class DataAnalysisController {

    @Autowired
    private DataAnalysisService dataAnalysisService;


    @RequestMapping("/income")
    public String income() {
        return "dataanalysis/income";
    }

    @ResponseBody
    @RequestMapping("/monthIncomes")
    public List<MonthIncome> monthIncomes() {
        return dataAnalysisService.getMonthIncomes();
    }
}
